import { Tools } from 'weaver-mobile';
import { catchApiError } from '../util/index';
import { PARAMS } from '../components/public/BlogUtils';

// 当前用户信息
export const getCurrentUserInfo = params => {
	let options = {
		method: 'GET',
		url: '/api/blog/base/getCurrentUserInfo',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 我的微博-统计数字
export const getMenuCountData = params => {
	let options = {
		method: 'GET',
		url: '/api/blog/base/getBlogMenuCountdata',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 最近来访、最近访问列表
export const getVisitorList = params => {
	let options = {
		method: 'GET',
		url: '/api/blog/base/getVisitorList',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

//消息提醒页面

// 消息提醒--列表
export const getMsgRemindList = params => {
  return Tools.callApi({
      url: '/api/blog/base/getMsgRemindList',
      method: 'GET',
      params: {...PARAMS, ...params}
  });
};

// 消息提醒--全部忽略
export const neglectMsgRemindAll = params => {
  return Tools.callApi({
      url: '/api/blog/base/neglectMsgRemindAll',
      method: 'POST',
      params: {...PARAMS, ...params}
  });
};

// 消息提醒--忽略
export const neglectMsgRemind = params => {
  return Tools.callApi({
      url: '/api/blog/base/neglectMsgRemind',
      method: 'POST',
      params: {...PARAMS, ...params}
  });
};

// 消息提醒--同意与拒绝
export const dealMsgRemind = params => {
  return Tools.callApi({
      url: '/api/blog/base/dealMsgRemind',
      method: 'POST',
      params: {...PARAMS, ...params}
  });
};

/* 微博设置 */
// 基本设置信息获取
export const getBaseSetting = params => {
  return Tools.callApi({
      url: '/api/blog/setting/getUserBlogBaseSetting',
      method: 'GET',
      params: {...PARAMS, ...params}
  });
};

// 基本设置信息保存
export const saveBaseSetting = params => {
  return Tools.callApi({
      url: '/api/blog/setting/saveBlogUserSetting',
      method: 'POST',
      params: {...PARAMS, ...params}
  });
};

// 默认分享
export const getDefaultShareList = params => {
	let options = {
		method: 'GET',
		url: '/api/blog/shareset/getBlogShareSetListDefaultCondition',
		params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}

// 我的分享
export const getBlogShareSetListCondition = params => {
	let options = {
    url: '/api/blog/shareset/getBlogShareSetListCondition',
    method: 'GET',
    params: {...PARAMS, ...params}
	};
	return Tools.callApi(options).then(catchApiError);
}